package models

import "gorm.io/gorm"

type Goods struct {
	gorm.Model
	Title  string  `gorm:"type:varchar(30);not null;comment:商品标题"`
	Price  float64 `gorm:"type:decimal(10,2);not null;comment:商品价格"`
	Num    int     `gorm:"type:int(11);not null;comment:商品数量"`
	Status int     `gorm:"type:int(30);not null;default:1;comment:0 未上架 , 1 已上架"`
}

func (g *Goods) FindGoodsById() error {
	return DB.Debug().First(&g).Error
}
